﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Collections;
using System.Diagnostics;
using Library;

[RunInstaller(true)]
public partial class Installer1 : System.Configuration.Install.Installer
{
    public Installer1()
    {
        //InitializeComponent();
    }

    [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
    public override void Install(IDictionary stateSaver)
    {

        System.Diagnostics.Debugger.Break();
        base.Install(stateSaver);

        //using (Process registryInput = Process.Start("regedit.exe", "/s Settings1.reg"))
        //{
        //    registryInput.WaitForExit();
        //}

        //using (Process registryInput = Process.Start("regedit.exe", "/s Settings2.reg"))
        //{
        //    registryInput.WaitForExit();
        //}
        clsDropDB clsDB = new clsDropDB();
        clsDB.DropDatabase("QLCF");
    }

    [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
    public override void Commit(IDictionary savedState)
    {        
        base.Commit(savedState);        
    }

    [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
    public override void Rollback(IDictionary savedState)
    {
        base.Rollback(savedState);
    }

    [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
    public override void Uninstall(IDictionary savedState)
    {
        clsDropDB clsDB = new clsDropDB();
        clsDB.DropDatabase("QLCF");
        base.Uninstall(savedState);
        
    }
}